<%@ page language="java" import="pos.domain.*,pos.data.*,java.util.*,pos.presentation.*;"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<%
	String userName = (String) request.getParameter("user");
	String idEvento = (String) request.getParameter("idEvento");
	String peticion = (String) request.getParameter("Peticion");
	String volver = (String) request.getParameter("Volver");
	IGestorEventos gE = new GestorEventos();
	IGestorUsuarios gU = new GestorUsuarios();
	Evento ev;
	ev = (Evento) gE.getEvento(idEvento);
	
	if (peticion.equals("cierto")){
		Usuario u = gU.getUsuario(userName);
		gE.addInscripciones(u.getUserName(),ev.geteventoid());
		List lP = ev.getPeticiones();
		lP.add(u);
		ev.setPeticiones(lP);
		response.sendRedirect("FrontController?res=Evento.jsp?userName=" + userName);
	}
	if (volver.equals("cierto")){
		response.sendRedirect("FrontController?res=Evento.jsp?userName=" + userName);		
	}
%>
</body>
</html>